<template>
  <div class="p24 page-miH page-bgBack">
    <Title>消息设置</Title>
    <p class="subhead_title">选择接收消息的类型、人员、接收方式以及接收日期时间。</p>
    <!-- 表格区域 -->
    <a-table
      :loading="loading"
      childrenColumnName="noticeTypeList"
      :expandIcon="expandIcon"
      :pagination="false"
      :expandedRowKeys="expandedRowKeys"
      :columns="columns"
      rowKey="ids"
      :data-source="data"
    >
      <div slot="empInfoVOList" slot-scope="text, record">
        <div v-if="record.noticeRuleSettingListVO">
          <span v-if="containType(record.noticeRuleSettingListVO.empType, '0')">
            {{ record.noticeRuleSettingListVO.userVOList | empInfoVOLists }}
            {{ record.noticeRuleSettingListVO.userVOList | empInfoVOList }} 人
          </span>
          <span v-if="containType(record.noticeRuleSettingListVO.empType, '2')">发起者本人</span>
          <span v-if="containType(record.noticeRuleSettingListVO.empType, '1')">全部</span>
          <span v-if="containType(record.noticeRuleSettingListVO.empType, '3')">渠道</span>
        </div>
      </div>

      <div slot="receiveMode" slot-scope="text, record">
        <span v-if="record.noticeRuleSettingListVO">{{ record.noticeRuleSettingListVO.receiveType | receiveType }}</span>
      </div>
      <div v-if="record.code" slot="receiptDate" slot-scope="text, record">
        <span v-if="record.noticeRuleSettingListVO">{{ record.noticeRuleSettingListVO | receiptDates }}</span>
      </div>
      <div slot="active" slot-scope="text, record">
        <div v-show="record.code">
          <a-space>
            <a-button type="link" @click="showDrawer(record)">编辑</a-button>

            <a-switch
              v-if="record.noticeRuleSettingListVO"
              @click="isOpen(record.noticeRuleSettingListVO)"
              v-model="record.noticeRuleSettingListVO.enableStatus"
            />
          </a-space>
        </div>
      </div>
    </a-table>
    <!-- 编辑对话框 -->
    <a-drawer
      :maskClosable="false"
      width="650"
      title="编辑"
      placement="right"
      :closable="false"
      :visible="visible"
      :after-visible-change="afterVisibleChange"
      @close="onClose"
    >
      <!-- 内容区域 start -->
      <div class="editTop">{{ titleName }}</div>
      <div class="pl24">
        <p class="editFont14">接收人员</p>
        <template v-if="editForm.noticeTypeCode === 'eventHandling' || editForm.noticeTypeCode === 'jfContract'">
          <a-tree-select
            v-model="userTreeSelected"
            :treeData="userTreeData"
            showSearch
            treeCheckable
            treeNodeFilterProp="title"
            placeholder="请选择接收人员"
            style="width: 300px"
          />
          <div v-show="userTreeSelectedLabels.length > 0" class="mt8">
            已选择 {{ userTreeSelectedLabels[0] }} 等 {{ userTreeSelectedLabels.length }} 人
          </div>
        </template>
        <template v-else>
          <div v-if="visible">
            <a-checkbox-group :default-value="getDefaultCheck(editForm.empType)" :options="handleP()" @change="checkBoxOnChange" />
            <a-button v-if="visible && getShowSelect(editForm.empType)" @click="onEmp">选择人员和渠道</a-button>
          </div>
          <div v-if="getShowSelect(editForm.empType)">
            已选择
            <span v-if="visible && editForm.userVOList && editForm.userVOList.length !== 0">{{
              editForm.userVOList | empInfoVOLists
            }}</span>
            <span>{{ editForm.userVOList | empInfoVOList }}</span>
            人
          </div>
        </template>
        <p class="editFont14">接收方式</p>
        <a-checkbox-group v-model="editForm.receiveType" name="checkboxgroup" :options="plainOptions" />
        <p class="editFont14">接收时间</p>
        <a-radio-group name="radioGroup" @change="changeReceiveDateType" v-model="editForm.receiveDateType">
          <a-radio :value="1">
            {{
              editForm.noticeTypeCode === "retire" ||
              editForm.noticeTypeCode === "contractExpires" ||
              editForm.noticeTypeCode === "jfContract"
                ? "当天"
                : "实时"
            }}
          </a-radio>
          <a-radio v-show="getIsShowAdvance(editForm.noticeTypeCode)" :value="2">提前提醒</a-radio>
          <a-radio v-show="getIsShowFixed(editForm.noticeTypeCode)" :value="3">固定时间</a-radio>
        </a-radio-group>

        <!-- 提前提醒 -->
        <div
          v-if="
            editForm.receiveDateType === 1 &&
            (editForm.noticeTypeCode === 'retire' ||
              editForm.noticeTypeCode === 'contractExpires' ||
              editForm.noticeTypeCode === 'jfContract')
          "
          class="mt16"
        >
          <span
            v-if="
              editForm.noticeTypeCode !== 'retire' &&
              editForm.noticeTypeCode !== 'contractExpires' &&
              editForm.noticeTypeCode !== 'jfContract'
            "
            >提前&nbsp;&nbsp;</span
          >
          <a-time-picker v-model="appointTime" :default-open-value="moment('00:00', 'HH:mm')" format="HH:mm" @change="onChangeTime" />
          <span>&nbsp;&nbsp;&nbsp;消息提醒</span>
        </div>
        <div v-if="editForm.receiveDateType === 2 && getIsShowAdvance(editForm.noticeTypeCode)" style="margin-top: 15px">
          <span>提前&nbsp;&nbsp;</span>
          <div style="width: 100px; display: inline-block; margin-right: 10px">
            <a-input-number
              v-model="editForm.receiveDateJson.number"
              placeholder="请选择"
              type="number"
              :min="1"
              :max="
                editForm.receiveDateJson.unit === 1
                  ? 60
                  : editForm.receiveDateJson.unit === 2
                  ? 24
                  : editForm.noticeTypeCode === 'contractExpires' || editForm.noticeTypeCode === 'jfContract'
                  ? 90
                  : 365
              "
            />
          </div>
          <span>&nbsp;&nbsp;</span>
          <a-select v-model="editForm.receiveDateJson.unit" style="margin-right: 10px; width: 120px">
            <a-select-option :value="i.id" v-for="i in unitList" :key="i.id">{{ i.name }}</a-select-option>
          </a-select>
          <a-time-picker
            v-if="empCode === 'retire' || empCode === 'contractExpires' || empCode === 'jfContract'"
            v-model="appointTime"
            :default-open-value="moment('00:00', 'HH:mm')"
            format="HH:mm"
            @change="onChangeTime"
          />
          <span>&nbsp;&nbsp;&nbsp;消息提醒</span>
        </div>
        <div v-if="editForm.receiveDateType === 3 && getIsShowAdvance(editForm.noticeTypeCode)" class="mt16">
          <span>每月&nbsp;&nbsp;&nbsp;</span>
          <a-select :default-value="1" v-model="editForm.receiveDateJson.day" style="width: 120px; margin-right: 10px">
            <span>&nbsp;&nbsp;</span>
            <a-select-option v-for="(item, index) in 31" :key="index" :value="index + 1">{{ index + 1 }}</a-select-option>
          </a-select>
          <span v-if="editForm.noticeTypeCode === 'contractExpires' || editForm.noticeTypeCode === 'jfContract'"
            >号&nbsp;&nbsp;&nbsp;&nbsp;</span
          >
          <a-time-picker
            v-if="editForm.noticeTypeCode === 'contractExpires' || editForm.noticeTypeCode === 'jfContract'"
            :value="editForm.receiveDateJson.time ? moment(editForm.receiveDateJson.time, 'HH:mm') : ''"
            @change="onChange"
            format="HH:mm"
          />
          <a-time-picker
            v-else
            :value="editForm.receiveDateJson.time ? moment(editForm.receiveDateJson.time, 'HH:mm:ss') : ''"
            @change="onChange"
          />

          <span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;消息提醒</span>
        </div>
      </div>

      <!-- 内容区域 end -->
      <div
        :style="{
          position: 'absolute',
          right: 0,
          bottom: 0,
          width: '100%',
          borderTop: '1px solid #e9e9e9',
          padding: '10px 16px',
          background: '#fff',
          textAlign: 'center',
          zIndex: 1
        }"
      >
        <a-button :style="{ marginRight: '8px' }" @click="onClose">取 消</a-button>
        <a-button type="primary" @click="onEdit">确 认</a-button>
      </div>
    </a-drawer>
    <employee-select :show.sync="visibleEmp" :default-selected-keys="defaultSelectedKeys" @change="onEmployeeSelectChange" />
  </div>
</template>

<script>
import moment from "moment";
import { userList, listSiteAll } from "@/api/company/contract";
import { listAllGroup, close, open, saveOrUpdateNoticeRuleSetting } from "./api";
import EmployeeSelect from "@/components/EmployeeSelect2/employeeSelect11";
export default {
  components: {
    EmployeeSelect
  },
  data() {
    return {
      userTreeSelected: [],
      userTreeMap: {},
      userTreeData: null,
      appointTime: null,
      unitList: [],
      defaultSelectedKeys: [],
      options2: [],
      empCode: null,
      empList: [],
      visibleEmp: false,
      confirmLoadingEmp: false,
      value1: 1,
      editForm: {
        hrNoticeDateSettingVO: {}
      },
      expandedRowKeys: [],
      loading: false,
      plainOptions: [
        { label: "微信推送", value: "weiXin" },
        { label: "电脑端通知", value: "system" }
      ],
      titleName: "",
      visible: false,
      value: [],
      data: [],
      columns: [
        {
          title: "消息类型",
          dataIndex: "name",
          width: "180px",
          ellipsis: true
        },
        {
          title: "接收人员",
          dataIndex: "empInfoVOList",
          scopedSlots: { customRender: "empInfoVOList" }
        },
        {
          title: "接收方式",
          dataIndex: "receiveMode",
          scopedSlots: { customRender: "receiveMode" }
        },
        {
          title: "接收日期时间",
          dataIndex: "receiptDate",
          scopedSlots: { customRender: "receiptDate" }
        },
        {
          title: "操作",
          dataIndex: "active",
          width: "220px",
          scopedSlots: { customRender: "active" }
        }
      ],
      emy_qudao_list: []
    };
  },
  computed: {
    userTreeSelectedLabels() {
      return this.userTreeSelected.map((li) => this.userTreeMap[li]);
    }
  },
  watch: {
    "editForm.receiveDateJson.number": {
      handler(val) {
        if (this.editForm.receiveDateJson) {
          this.editForm.receiveDateJson.number = val ? parseInt(val) : null;
        }
      },
      deep: true,
      immediate: true
    }
  },
  created() {
    this.$store.commit("navtab/updateOpenKeys", ["/messageModules"]);
    this.$store.commit("navtab/updateSelectedKeys", ["/message/setting"]);

    this.getListAllGroup(true);

    listSiteAll({})
      .then((res) => {
        if (res.data) {
          this.emy_qudao_list = this.emy_qudao_list.concat(res.data);
        }
      })
      .catch((err) => {
        console.log("debug log --> ", err);
      });

    userList({}, this.$store.state.hr.companyId)
      .then((res) => {
        if (res.data) {
          this.emy_qudao_list = this.emy_qudao_list.concat(res.data);
        }
      })
      .catch((err) => {
        console.log("debug log --> ", err);
      });
  },
  mounted() {},
  filters: {
    receiptDates(val) {
      const data = JSON.parse(JSON.stringify(val));
      data.receiveDateJson = JSON.parse(data.receiveDateJson);
      let tetx = "";
      if (data.receiveDateType === 1) {
        if (data.noticeTypeCode === "retire" || data.noticeTypeCode === "contractExpires" || data.noticeTypeCode === "jfContract") {
          tetx = "当天";
        } else {
          tetx = "实时";
        }
      }
      if (data.receiveDateType === 2) {
        tetx = `提前 ${!data.receiveDateJson.number ? 0 : data.receiveDateJson.number}`;
        if (data.receiveDateJson.unit === 1) {
          tetx += " 分钟";
        }
        if (data.receiveDateJson.unit === 2) {
          tetx += " 小时";
        }
        if (data.receiveDateJson.unit === 3) {
          tetx += " 天";
        }
      }
      if (data.receiveDateType === 3) {
        //  每月10号12：00
        tetx = `每月 ${data.receiveDateJson.day} 号 ${data.receiveDateJson.time} `;
      }
      return tetx;
    },
    empInfoVOLists(val) {
      let text = "";

      if (val && val !== null && val.length > 0) {
        const arr = [];
        val.forEach((element) => {
          arr.push(element.name);
        });
        if (arr.length === 2 || arr.length === 1) {
          text = arr.splice(0, 2).join(",") + " ";
        } else {
          text = arr.splice(0, 2).join(",") + " 等 ";
        }
      }
      return text;
    },
    empInfoVOList(value) {
      return value ? value.length : 0;
    },
    receiveType(data) {
      const _data = JSON.parse(JSON.stringify(data)).split(",");
      let text = "";
      if (_data.length > 0) {
        if (_data.indexOf("weiXin") !== -1) {
          text += `微信推送   `;
        }
        if (_data.indexOf("desc") !== -1) {
          text += `短信   `;
        }
        if (_data.indexOf("email") !== -1) {
          text += `邮箱   `;
        }
        if (_data.indexOf("system") !== -1) {
          text += `电脑端通知   `;
        }
      } else {
        text = "--";
      }

      return text;
    }
  },
  methods: {
    containType(empty, tag) {
      return empty.indexOf(tag) !== -1;
    },
    handleP() {
      if (this.empCode === "memoRemind") {
        return [{ label: "发起者本人", value: "2" }];
      } else if (this.empCode === "approval") {
        return [{ label: "审批节点所属", value: "2" }];
      } else {
        return [
          { label: "用工单位管理员", value: "1" },
          { label: "自定义", value: "0" },
          { label: "所属渠道", value: "3" }
        ];
      }
    },
    getShowSelect(sli) {
      return this.getDefaultCheck(sli).indexOf("0") !== -1;
    },
    getDefaultCheck(sli) {
      if (sli) {
        return sli.split(",");
      } else {
        return [];
      }
    },
    // 添加员工
    onEmployeeSelectChange(value) {
      this.editForm.userVOList = value;
      this.defaultSelectedKeys = value.map((item) => item.id);
    },

    onChangeTime(time, timeString) {
      this.editForm.receiveDateJson = {
        ...this.editForm.receiveDateJson,
        appointTime: timeString + ":00"
      };
    },
    radioGroupChange(e) {
      this.editForm.userVOList = [];
    },
    checkBoxOnChange(checkedList) {
      this.editForm.empType = "";
      for (var i = 0; i < checkedList.length; i++) {
        if (i === checkedList.length - 1) {
          this.editForm.empType += checkedList[i];
        } else {
          this.editForm.empType += checkedList[i] + ",";
        }
      }
    },
    onChange(time, timeString) {
      if (timeString.split(":").length === 2) {
        timeString += ":00";
      }
      this.editForm.receiveDateJson.time = timeString;
    },

    changeReceiveDateType(e) {
      if (e.target.value === 2 || e.target.value === "2") {
        this.editForm.receiveDateJson = {
          ...this.editForm.receiveDateJson,
          unit: this.empCode === "retire" || this.empCode === "contractExpires" || this.empCode === "jfContract" ? 3 : 1,
          number: 1
        };
      }
      if (e.target.value === 1 || e.target.value === "1") {
        this.editForm.receiveDateJson = {};
      }
      if (e.target.value === 3 || e.target.value === "3") {
        this.editForm.receiveDateJson = {
          day: 1,
          time: ""
        };
      }
    },
    onEdit() {
      const editForm = JSON.parse(JSON.stringify(this.editForm));
      if (
        editForm.receiveDateType === 1 &&
        (editForm.noticeTypeCode === "retire" ||
          editForm.noticeTypeCode === "contractExpires" ||
          editForm.noticeTypeCode === "jfContract") &&
        editForm.receiveDateJson.appointTime === ":00"
      ) {
        this.$notification.error({
          message: "请设置接收时间",
          description: "请设置接收时间"
        });
        return;
      }

      if (editForm.noticeTypeCode === "eventHandling" || editForm.noticeTypeCode === "jfContract") {
        if (this.userTreeSelected.length <= 0) {
          this.$notification.error({
            message: "接收人员",
            description: "请选择接收人员"
          });
          return;
        }
        editForm.userIds = this.userTreeSelected.join(",");
      } else {
        if (this.getShowSelect(editForm.empType)) {
          if (editForm.userVOList.length === 0) {
            this.$notification.error({
              message: "自定义人员",
              description: "请选择接收人员"
            });
            return;
          }
        }
        editForm.channelIds = "";
        editForm.userIds = "";

        editForm.userVOList.map((item) => {
          if (Object.prototype.hasOwnProperty.call(item, "adminUserId")) {
            // 渠道
            editForm.channelIds += item.id + ",";
          } else {
            // 管理员
            editForm.userIds += item.id + ",";
          }
        });
        editForm.channelIds = editForm.channelIds.substring(0, editForm.channelIds.length - 1);
        editForm.userIds = editForm.userIds.substring(0, editForm.userIds.length - 1);
        delete editForm.userVOList;
      }

      if (editForm.receiveDateType === 2) {
        if (!editForm.receiveDateJson.number) {
          this.$notification.error({
            message: "提前提醒错误",
            description: "请设置提前提醒"
          });
          return;
        }
      }
      if (editForm.receiveDateType === 3) {
        if (!editForm.receiveDateJson.day) {
          this.$notification.error({
            message: "固定提醒",
            description: "请设置固定提醒日"
          });
          return;
        } else if (editForm.receiveDateJson.time === "" || !editForm.receiveDateJson.time) {
          this.$notification.error({
            message: "固定提醒",
            description: "请设置固定提醒时间"
          });
          return;
        }
      }

      editForm.receiveType = editForm.receiveType.join(",");
      saveOrUpdateNoticeRuleSetting(editForm)
        .then((result) => {
          this.visible = false;
          this.getListAllGroup();
          this.$message.success("修改成功");
        })
        .catch((err) => {
          console.log("debug log --> ", err);
        });
    },
    // 是否开启
    isOpen(data) {
      if (data.enableStatus) {
        open(data.id).finally(() => {
          this.getListAllGroup();
        });
      } else {
        close(data.id).finally(() => {
          this.getListAllGroup();
        });
      }
    },
    onEmp() {
      this.visibleEmp = true;
    },
    handleOk(e) {
      this.confirmLoadingEmp = true;
      setTimeout(() => {
        this.visibleEmp = false;
        this.confirmLoadingEmp = false;
      }, 300);
    },
    handleCancel(e) {
      this.visibleEmp = false;
    },
    getListAllGroup(isInit) {
      this.loading = true;
      listAllGroup({ companyId: this.$store.state.hr.companyId })
        .then((res) => {
          const st = isInit ? this.$route.query.operateFromShortcut : null;
          res.data.forEach((element, index) => {
            res.data[index].ids = index + 1 + "as";
            if (st && st === element.name) {
              this.expandedRowKeys = [res.data[index].ids];
            }
            if (element.noticeTypeList && element.noticeTypeList.length > 0) {
              element.noticeTypeList.forEach((esy, indexs) => {
                if (esy.noticeRuleSettingListVO) {
                  if (!esy.noticeRuleSettingListVO.userVOList) {
                    esy.noticeRuleSettingListVO.userVOList = [];
                  }
                }

                res.data[index].noticeTypeList[indexs].ids = indexs + 1000 * index;
              });
            }
          });
          this.data = res.data.filter((item) => item.noticeTypeList);
        })
        .catch((err) => {
          console.log("debug log --> ", err);
        })
        .finally(() => {
          this.loading = false;
        });
    },
    afterVisibleChange(val) {},
    async showDrawer(record) {
      console.log(record);
      if (record.code === "eventHandling" || record.code === "jfContract") {
        await this.$request({
          url: `/hr/api/v1/users/queryUserListLessToMe`
        })
          .then((res) => {
            const roleMap = {};
            const userMap = {};
            for (let i = 0; i < res.data.length; i++) {
              const item = res.data[i];
              const roleId = item.roleId;
              userMap[item.id] = item.name;
              if (!roleMap[roleId]) {
                roleMap[roleId] = {
                  checkable: false,
                  title: item.roleName,
                  value: roleId,
                  key: roleId,
                  children: []
                };
              }
              roleMap[roleId].children.push({
                title: item.name,
                value: item.id,
                key: item.id
              });
            }
            this.userTreeData = Object.values(roleMap);
            this.userTreeMap = userMap;
          })
          .catch((err) => {
            console.log(err);
          });
      }
      this.editForm = JSON.parse(JSON.stringify(record.noticeRuleSettingListVO));

      this.defaultSelectedKeys = [];
      if (this.editForm.hrNoticeUserIdJsonVO && this.editForm.hrNoticeUserIdJsonVO.userIds) {
        this.defaultSelectedKeys = this.defaultSelectedKeys.concat(this.getDefaultCheck(this.editForm.hrNoticeUserIdJsonVO.userIds));
      }
      if (this.editForm.hrNoticeUserIdJsonVO && this.editForm.hrNoticeUserIdJsonVO.channelIds) {
        this.defaultSelectedKeys = this.defaultSelectedKeys.concat(this.getDefaultCheck(this.editForm.hrNoticeUserIdJsonVO.channelIds));
      }
      this.editForm.userVOList = [];
      this.emy_qudao_list.map((item) => {
        this.defaultSelectedKeys.map((id) => {
          if (item.id === id) {
            this.editForm.userVOList.push(item);
          }
        });
      });

      if (this.editForm.empType === null || this.editForm.empType === "null") {
        this.editForm.empType = false;
      }

      this.editForm.receiveDateJson = JSON.parse(this.editForm.receiveDateJson);

      this.editForm.receiveType = this.editForm.receiveType.split(",");
      this.titleName = record.name;
      this.empCode = record.code;

      if (record.code) {
        this.userTreeSelected = this.editForm.userIds ? this.editForm.userIds.split(",") : [];
      }

      if (this.empCode === "approval") {
        // 审批
        this.editForm.empType = "2"; // 发起者本人
      }
      this.visible = true;
      if (this.empCode === "retire" || this.empCode === "contractExpires" || this.empCode === "jfContract") {
        this.unitList = [
          {
            id: 3,
            name: "天"
          }
        ];
      } else {
        this.unitList = [
          {
            id: 1,
            name: "分钟"
          },
          {
            id: 2,
            name: "小时"
          },
          {
            id: 3,
            name: "天"
          }
        ];
      }
      if (this.empCode === "retire" || this.empCode === "contractExpires" || this.empCode === "jfContract") {
        this.appointTime =
          record.noticeRuleSettingListVO.hrNoticeDateSettingVO && record.noticeRuleSettingListVO.hrNoticeDateSettingVO.appointTime
            ? moment(record.noticeRuleSettingListVO.hrNoticeDateSettingVO.appointTime, "HH:mm")
            : moment("09:00", "HH:mm");
        if (!record.noticeRuleSettingListVO.hrNoticeDateSettingVO || !record.noticeRuleSettingListVO.hrNoticeDateSettingVO.appointTime) {
          this.editForm.receiveDateJson = {
            ...this.editForm.receiveDateJson,
            appointTime: "09:00:00"
          };
        } else if (!this.editForm.receiveDateJson.appointTime) {
          this.editForm.receiveDateJson = {
            ...this.editForm.receiveDateJson,
            appointTime: record.noticeRuleSettingListVO.hrNoticeDateSettingVO.appointTime
          };
        }
      } else {
        this.appointTime =
          record.noticeRuleSettingListVO.hrNoticeDateSettingVO && record.noticeRuleSettingListVO.hrNoticeDateSettingVO.appointTime
            ? moment(record.noticeRuleSettingListVO.hrNoticeDateSettingVO.appointTime, "HH:mm:ss")
            : null;
      }
    },
    onClose() {
      this.visible = false;
    },
    // 自定义图标
    expandIcon(props) {
      if (this.data.length > 0) {
        if (props.expanded) {
          if (props.record.noticeTypeList) {
            // 有数据-展开时候图标
            return (
              <a
                style="color: 'black',margin-right:0px"
                onClick={(e) => {
                  this.expandedRowKeys = this.expandedRowKeys.filter((item) => item !== props.record.ids);
                }}
              >
                <a-icon type="caret-down" />{" "}
              </a>
            );
          } else {
            return <span> </span>;
          }
        } else {
          if (props.record.noticeTypeList) {
            // 有数据-未展开时候图标
            return (
              <a
                style="color: 'black' ,margin-right:0px"
                onClick={(e) => {
                  this.expandedRowKeys.push(props.record.ids);
                }}
              >
                <a-icon type="caret-right" />{" "}
              </a>
            );
          } else {
            return <span> </span>;
          }
        }
      } else {
        // 无数据-图标
        return (
          <span style="margin-right:0px">
            <a-icon type="smile" />{" "}
          </span>
        );
      }
    },
    // 获取提前
    getIsShowAdvance(value) {
      switch (value) {
        case "preTurnOfficial":
        case "preTransfer":
        case "preResign":
        case "contractExpires":
        case "jfContract":
        case "preInduction":
        case "retire":
          return true;
        default:
          return false;
      }
    },
    getIsShowFixed(value) {
      switch (value) {
        case "preTurnOfficial":
        case "preTransfer":
        case "preResign":
        case "contractExpires": // case "jfContract":
        case "preInduction":
          return true;
        default:
          return false;
      }
    }
  }
};
</script>

<style lang="scss" scoped>
.subhead_title {
  font-size: 12px;
  font-weight: 400;
  color: #666666;
  margin-top: 12px;
  margin-bottom: 24px;
}
.editTop {
  height: 48px;
  background: #fafafa;
  font-size: 16px;
  font-weight: 500;
  line-height: 48px;
  color: #333333;
  padding-left: 24px;
  margin-bottom: 27px;
}
.editFont14 {
  height: 14px;
  font-size: 14px;
  font-weight: 500;
  color: #3c3d43;
  margin: 15px 0;
}
</style>
